package com.gpay.erp.services.storage.impl;

import com.gpay.erp.core.dao.BaseDao;
import com.gpay.erp.core.dao.page.PagerModel;
import com.gpay.erp.services.storage.StorageSubService;
import com.gpay.erp.services.storage.bean.StorageSub;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * Created by wuzonghui on 15/11/23.
 */
@Service
public class StorageSubServiceImpl implements StorageSubService {
    @Resource
    private BaseDao dao;

    @Override
    public int insert(StorageSub storageSub) {
        return dao.insert("storageSub.insert",storageSub);
    }

    @Override
    public int delete(StorageSub storageSub) {
        return 0;
    }

    @Override
    public int deletes(String[] ids) {
        return 0;
    }

    @Override
    public int update(StorageSub storageSub) {
        return dao.update("storageSub.update",storageSub);
    }

    @Override
    public StorageSub selectOne(StorageSub storageSub) {
        return null;
    }

    @Override
    public StorageSub selectById(String id) {
        return (StorageSub) dao.selectOne("storageSub.selectById",id);
    }

    @Override
    public List<StorageSub> selectByFId(String f_storageId) {
        return dao.selectList("storageSub.selectByFId",f_storageId);
    }

    /**
     * 查询捆包号是否重复
     * @param packageNumber 捆包号
     * @return
     */
    @Override
    public List<StorageSub> selectByPackageNumber(String packageNumber) {
        return dao.selectList("storageSub.selectByPackageNumber",packageNumber);
    }

    @Override
    public HashMap selectTotalByOne(StorageSub storageSub) {
        return (HashMap) dao.selectOne("storageSub.selectTotalByFstorageId",storageSub);
    }

    @Override
    public PagerModel selectPageList(StorageSub storageSub) {
        return null;
    }

    @Override
    public List<StorageSub> selectList(StorageSub storageSub) {
        return null;
    }
}
